﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

public partial class Admin_Service_deldept : ManagePageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //stuNum,stuName,stuPas,stuEmail,stuDept=
        string id = Request.Form["id"].Trim();
        


        if (!IsPostBack) {
            string result = "0";
            //更新教师表部门字段
            string[] _deptid = isTheMe.DepartmentID.Trim().Split(',');
            string[] arr = { "abc1 ", "abc2 ", "abc3 ", };
            ArrayList al = new ArrayList();
            for (int i = 0; i < _deptid.Length;i++ ) {
                if (_deptid[i].Trim() != id) {
                    if (_deptid[i].Trim() != "") {
                        al.Add(_deptid[i].Trim());
                    }
                }
            }
            string str = string.Join(",", (string[])al.ToArray(typeof(string)));
            isTheMe.DepartmentID = str.Trim(',').Trim();
            UserCookiesManage.SaveManageCookies(isTheMe);
            if (new Exam.Core.DAL.Department().Del(int.Parse(id)))
                result = "1";
            Response.Write(result);
            Response.End();
        }
    }
}